package com.jt.www.admin.order_pc.service;

import com.jt.www.domain.bo.OfflineOrderBO;
import com.jt.www.domain.dto.OfflineOrderInputDTO;
import com.jt.www.domain.dto.OfflineProductDTO;
import com.jt.www.domain.po.OfflineOrder;
import com.jt.www.domain.qo.OfflineOrderQO;
import com.jt.www.domain.qo.OfflinePolicyQO;
import com.jt.www.domain.qo.SavePolicyDetailFileQo;
import com.jt.www.domain.vo.OfflineOrderVo;
import com.jt.www.model.reps.GenericDataResponse;
import com.jt.www.model.reps.GenericListResponse;
import org.springframework.http.ResponseEntity;

import java.util.List;
import java.util.Map;

/**
 * Created by shaoyn on 2020/05/22.
 */
public interface OfflineOrderService {

    /**
     * 保存线下录单
     *
     * @param offlineOrderInputDTO
     * @return
     */
    ResponseEntity saveOfflineOrder(String findCode, OfflineOrderInputDTO offlineOrderInputDTO) throws Exception;

    /**
     * 查询线下录单列表
     *
     * @param offlinePolicyQO
     * @return
     */
    ResponseEntity<GenericListResponse<OfflineOrderVo>> queryOfflinePolicy(OfflinePolicyQO offlinePolicyQO);

    ResponseEntity checkFileIntertemporal(String findCode,String policyFile)throws Exception;

    ResponseEntity reclaim(List<Map<String, String>> operparam) throws Exception;

    /**
     * 查询保单录入详情
     *
     * @param orderId
     * @return
     */
    ResponseEntity<GenericDataResponse<OfflineOrderBO>> queryOfflineOrderDetails(Long orderId);

    /**
     * 修改保单录入
     *
     * @param offlineOrderInputDTO
     * @return
     */
    ResponseEntity updateOfflineOrder(String findCode, OfflineOrderInputDTO offlineOrderInputDTO) throws Exception;

    /**
     * 审核保单
     *
     * @param findCode
     * @param offlineOrder
     * @return
     */
    ResponseEntity auditOfflineOrder(String findCode, OfflineOrder offlineOrder) throws Exception;

    /**
     * 通过线下保单号查询保单信息
     *
     * @param policyNo
     * @return
     * @throws Exception
     */
    OfflineOrderVo queryByPolicyNo(String policyNo);

    /**
     * 推送到投保中心
     *
     * @param id
     */
    void pushPolicyToIns(String findCode, Long id) throws Exception;

    /**
     * 查询保单录入订单列表
     *
     * @param offlineOrderQO
     * @return
     */
    ResponseEntity<GenericListResponse<OfflineOrder>> queryOfflineOrder(OfflineOrderQO offlineOrderQO);

    /**
     * 查询保单录入中 除推送失败重复的保单号
     *
     * @param policyNos
     * @return
     */
    List<String> checkPolicyNos(List<String> policyNos);


    /**
     * 查询保单录入详情
     *
     * @param orderId
     * @return
     */
    ResponseEntity deleteOrder(Long orderId);

    /**
     * 关联/删除 线下录入的保单的人员清单
     *
     * @param findCode
     * @param savePolicyDetailFileQo
     * @return
     */
    ResponseEntity savePolicyDetailFile(String findCode, SavePolicyDetailFileQo savePolicyDetailFileQo) throws Exception;

    /**
     * 查询关联的人员清单
     *
     * @param policyNo
     * @return
     */
    ResponseEntity selectPolicyDetailFile(String policyNo);

    /**
     * 通过用户查询线下录入的产品列表
     *
     * @param findCode
     * @param userCode
     * @return
     */
    ResponseEntity<GenericListResponse<OfflineProductDTO>> offlineProductList(String findCode, String userCode);
}
